<?php
	$slide = NULL;
	if ($slides) {
		foreach ($slides as $s) {
			$slide = $s;
			break;
		}
	}
		
?>
<div id='slide'>
	<div class='main_img'>
		<img src='/uploads/cms/big_slide_<? echo ($slide)?($slide['picture']):"" ?>' />
		<div class='bg_main_img'></div>
	</div>
    <div class='logo_2'></div>
	<div class='slide_menu'>
	<?php
		$cnt = 0;
		foreach ($slides as $slide)
		{
			$cnt ++;
		?>
		<div class='slide_menu_item <?=($cnt==1)?"active":""?>' style='<?php echo ($cnt == 1)?"margin-left:0px;":""?>'>
			<img src='/uploads/cms/slide_<? echo $slide['picture'] ?>' />
            <div class='bg_slide_img bg_slide_img_<?php echo $cnt;?>'></div>
		</div>
		<?
		}
	?>
	</div>
</div>

<div class='wrap_datepicker'>
	<div class='title cufon'>
    	Dịch vụ
    </div>
</div>

<div class='wrap_ground'>
	<?php
	$cnt = 0;
	foreach ($pager as $cms)
	{
		$cnt ++;
	?>
    <div class='cms_item' style='<?=($cnt % 2 == 0)?"margin-right:0;":"margin-left:0;"?>'>
    	<a href='<? echo url_for('service/permalink?cms_id='.$cms['id'].'')?>'>
        	<img src='/uploads/cms/<?php echo ($cms['picture'])?$cms['picture']:""?>' align="left" style='padding-right:10px;' />
        </a>
        <span class='cms_content'>
            <div class='cms_name'>
            	<a href='<? echo url_for('service/permalink?cms_id='.$cms['id'].'')?>'>
					<?php echo ($cms['name'])?$cms['name']:""?>
                </a>
            </div>
            <div>
            	<?php echo ($cms['description'])?htmlspecialchars_decode($cms['description']):""?>
            </div>
        </span>
    </div>
    <?php
	}
	?>
    <div style='clear:both'></div>
</div>
<?php if ($pager->haveToPaginate()) { ?>
    <div class="pagination">
      <?php if (!$pager->isFirstPage()) { ?>
        <?php echo link_to_function("First page", 'listReload('.$pager->getFirstPage().')', array('class' => 'page')) ?>
        <?php echo link_to_function("Prev", 'listReload('.$pager->getPreviousPage().')', array('class' => 'page')) ?>
      <?php } ?>

      <?php foreach ($pager->getLinks() as $link) { ?>
        <?php if ($link == $pager->getPage()) { ?>
          <span class="page selected"><?php echo $link ?></span>
        <?php } else { ?>
          <?php echo link_to_function($link, 'listReload('.$link.')', array('class' => 'page')) ?>
        <?php } ?>
      <?php } ?>

      <?php if (!$pager->isLastPage()) { ?>
        <?php echo link_to_function("Next", 'listReload('.$pager->getNextPage().')', array('class' => 'page')) ?>
        <?php echo link_to_function("Last page", 'listReload('.$pager->getLastPage().')', array('class' => 'page')) ?>
      <?php } ?>
    </div>
<?php } ?>
<div class='copyright'>
    <div class='body_line'></div>
    <div style='text-align:center'>
        <?php echo htmlspecialchars_decode($copyright) ?>
    </div>
</div>